package com.bruce.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

import javax.sql.DataSource;

/**
 * @author luotuan
 * @Description
 * @create 2020-05-15 16:23
 **/
@Configuration
public class SpringCommonConfig {
    @Bean
    @Primary
    public NamedParameterJdbcTemplate namedParameterJdbcTemplate(@Autowired DataSource dataSource){
        return new NamedParameterJdbcTemplate(dataSource);
    }
}
